<?php
App::uses('AppModel', 'Model');
App::uses('AuthComponent', 'Controller/Component');

class MenuCategory extends AppModel {
	public $hasMany = array(
        'SubMenu' => array(
            'className' => 'SubMenu',
            'foreignKey' => 'menu_category_id',
            'order' => array('SubMenu.view_index' => 'asc'),
            'conditions' => array('SubMenu.deleted' => '0')
			)
        );
	public function findNameAndId(){
		return $this->query("SELECT id, category_name from menu_categories where deleted = 0");
	}

	/**
	 * find all data
	 */
	public function findAllData(){
		return $this->find('all', array(
			'conditions' => array('deleted' => 0)));
	}
}
